package com.zang.blogz.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zang.blogz.entity.Comment;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zang.blogz.model.input.ro.CommentRO;
import com.zang.blogz.model.output.CommentVO;
import com.zang.blogz.model.output.admin.AdminCommentVO;
import com.zang.blogz.result.Result;

import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author 朵橙i
 * @since 2022-06-17
 */
public interface CommentService extends IService<Comment> {

    /**
     * 根据文章id获取该文章对应的评论
     *
     * @param articleId 文章id
     * @return {@link List}<{@link CommentVO}>
     */
    List<CommentVO> getCommentByArticleId(Integer articleId);

    /**
     * 回复评论
     *
     * @param commentRo 评论信息
     * @return {@link Result}<{@link CommentRO}>
     */
    Result<CommentRO> addComment(CommentRO commentRo);

    /**
     * 开启审批状态
     *
     * @return {@link Result}<{@link String}>
     */
    Result<String> updateApprovalFlag();

    /**
     * 关闭审批状态
     *
     * @return {@link Result}<{@link String}>
     */
    Result<String> closureApprovalFlag();

    /**
     * 开启邮件通知功能
     *
     * @return {@link Result}<{@link String}>
     */
    Result<String> turnOnEmailNotifications();

    /**
     * 关闭邮件通知功能
     *
     * @return {@link Result}<{@link String}>
     */
    Result<String> closureOnEmailNotifications();

    /**
     * 查看未通过审批的评论
     *
     * @param page 分页对象
     * @return {@link IPage}<{@link AdminCommentVO}>
     */
    IPage<AdminCommentVO> didNotPass(Page<AdminCommentVO> page);

    /**
     * 查看已通过审批的评论
     *
     * @param page 分页对象
     * @return {@link IPage}<{@link AdminCommentVO}>
     */
    IPage<AdminCommentVO> pass(Page<AdminCommentVO> page);

    /**
     * 通过审核
     *
     * @param commentId 评论id
     * @return {@link Result}<{@link String}>
     */
    Result<String> approved(String commentId);
}
